function author(req, res, next) {
    if (req.url == "/login" || req.url == "/register") {
        next()
    } else if (req.session.userinfo) {
        next()
    } else {
        res.redirect("/login")
    }
}


module.exports = author